package com.springsecurity.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.springsecurity.bean.User;
import com.springsecurity.service.UserService;

@RestController
public class UserController {
	@Autowired
	private UserService userService;
	
	@PostMapping("/auth/register")
	public ResponseEntity<String> register(@RequestBody User user){
		userService.register(user);
		
		return ResponseEntity.ok("注册成功");
	}
}
